ActiveReports 12
Json Data Source
ActiveReports 12 > ActiveReports User Guide > Samples and Walkthroughs > Samples > Page Reports And RDL Reports > Data > Json Data Source

The Json Data Source sample demonstrates how to use the Json data provider. The sample uses a web service that requires authentication to access the Json data source at run time.

You must have IIS Express installed on your machine for the Json Data Source sample to run.

Sample Location

Visual Basic.NET

<User Folder>\GrapeCity Samples\ActiveReports 12\Page Reports And RDL Reports
\Data\JsonDataSource\VB.NET

C#

<User Folder>\GrapeCity Samples\ActiveReports 12\Page Reports And RDL Reports
\Data\JsonDataDataSource\C#

Run-Time Features

The sample consists of two projects: the Windows Application project with a report, MainForm, and DataLayer class that provides report data; and the Web Application project with a web service that provides access authentication for the report data at run time. 

When you run this sample, you will see the MainForm appear. The MainForm contains the ActiveReports Viewer that displays a report with a list of Customers from the Json data provider.

Note: To run this sample, you must have access to the Customers.json data file. A copy is located at [User Documents folder]\GrapeCity Samples\ActiveReports 12\Data. If you are unable to access the data files in the sample, create the Data folder and place all the data files in this folder, or change the reference path to the data files within the folder according to your environment.

Project Details

JsonDataSource

This is the Windows Application project that contains the MainForm, the sample page report, and the DataLayer file with the report data.

DataLayer

This file is an internal class that contains code to create the data connection. It provides interaction with the server containing Json data using HTTP, including the access credentials.

MainForm

This is the main form that appears when you run this sample. It uses the ActiveReports Viewer control to display the report at run time.

Right-click the form and select View Code to see how to load and show the report at run time.

testReport.rdlx

This is the report that gets displayed in the Viewer at run time. The report contains the embedded Json schema as the data source.

It uses the Table data region to display data from the Json data source, the Customers sample data file.

WebService

This is the Web Application project that contains the web service used to retrieve data from the Json data source for the sample report at run time.

BasicAuthHttpModule

This file is the public class that provides access authentication when the report connects to the Json data source at run time.

Service.asmx

This is the web service required to access the Json data provider.

Web.config

This is the web configuration file for configuring your web application.